const msg = (state: any, actions: any) => {
    const { type, key, list } = actions;
    if (!state) {
        const localeList: any = localStorage.getItem('ADD_MESSAGE') || '{}';
        return {
            localMessageList: localeList && JSON.parse(localeList)
        }
    }
    if (type === "ADD_MESSAGE") {
        state.localMessageList[key] = list
        localStorage.setItem('ADD_MESSAGE', JSON.stringify(state.localMessageList));
        return {
            ...state
        }
    }
    return state;
}
export default msg;